Skip to content

Sandbox docs: fix error in docs, add information around start_owner!/2 #665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 10, 2025

Conversation

novaugust
Copy link
Contributor

The existing moduledoc example for the sandbox doesn't work, as calling checkout and then start_owner! results in the following error:

** (MatchError) no match of right hand side value: {:error, {{:badmatch, {:already, :owner}}, [{Ecto.Adapters.SQL.Sandbox, :"-start_owner!/2-fun-0-", 3, [file: ~c"lib/ecto/adapters/sql/sandbox.ex", line: 451]}

I went digging for why start_owner!/2 exists and did my best to distill down what I learned into its documentation, while also nixing its reference from moduledocs to fix the error in the example.
That said, I'd very much appreciate any direction for better ways to document this information =) should start_owner! be prioritized over checkout in the moduledoc? i assumed no, since checkout is all-around simpler and more fool-proof.

as a note, we don't use start_owner! in our codebase but do have some live(...) calls - is the issue that caused the creation of start_owner! still around? (in other words, does this even still need to exist?)

@josevalim josevalim merged commit ad5e31c into elixir-ecto:master May 10, 2025
11 checks passed
@josevalim
Copy link
Member

💚 💙 💜 💛 ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants